<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" href="__PUBLIC__/member/style/common.css" media="screen"/>
        <script type="text/javascript" src="__PUBLIC__/common/js/jquery.js"></script>
        <!--<script type="text/javascript" src="__PUBLIC__/common/js/colorpicker/jquery-1.4.2.min.js"></script>-->
        <script type="text/javascript" src="__PUBLIC__/common/js/common.js"></script>
        <script type="text/javascript" src="__PUBLIC__/pano/pano.js"></script>
        {:W("Easyui")}
        {:W("Boluoui")}
        {:W("Uploader")}
        <script type="text/javascript">
            function checksb() {
                var result = true;
                if (result == true) {
                    result = AutoCheckSub(".cs");
                }
                if (result == true) {
                    var target_id = $("#target_id").val();
                    if (target_id == "0") {
                        showMsg("请选定目标场景！");
                        result = false;
                    }
                }
                return result;
            }
            $(document).ready(function() {
                onoroff();
                boluo_autocheckui();
                var krpano = document.getElementById("krpano");
            });</script>
        <style>
            .movebox{
                overflow: hidden;
            }
            .action_left{
                width: 140px; min-height: 200px; overflow: hidden; float: left;
            }
            .mypano{
                width: 760px; height: 480px; overflow: hidden; border:1px solid #ccc;
            }
        </style>
        <script type="text/javascript">
            function panoready() {

            }
            function onDrag(e) {
                var d = e.data;
                if (d.left < 0) {
                    d.left = 0
                }
                if (d.top < 0) {
                    d.top = 0
                }
                if (d.left + $(d.target).outerWidth() > $(d.parent).width()) {
                    d.left = $(d.parent).width() - $(d.target).outerWidth();
                }
                if (d.top + $(d.target).outerHeight() > $(d.parent).height()) {
                    d.top = $(d.parent).height() - $(d.target).outerHeight();
                }
            }
//            function changeCenter(va) {
//                setSpotcenter("#spot_edgebox", va);
//                var krpano = document.getElementById("krpano");
//                krpano.call("set(layer[spot].align," + va + ");");
//                $("#x").val(0);
//                $("#y").val(0);
//                krpano.call("set(layer[spot].x,0);");
//                krpano.call("set(layer[spot].y,0);");
//            }
            function shoot(x, y) {
                $("#x").val(x);
                $("#y").val(y);
            }
            function targetback(x, y) {
                $("#target_x").val(x);
                $("#target_y").val(y);
            }
            function setSpotcenter(me, va) {
                $(me).children("input").eq(0).val(va);
                $(me).children(".btn1").removeClass("me");
                $(me).children('.' + va).addClass("me");
            }
        </script>
    </head>
    <body>
        {:W("Bg")}
        <div id="upmain">
            <div class="main">
                <div class="main_head">
                    <div class="main_head_left"></div>
                    <div class="main_head_right"></div>
                    <div class="main_head_main">
                        <div class="title">全景项目 - {$panorow['title']}</div>
                        <div title="关闭" onclick="DoNote('确认返回功能首页？', '{:U('main / index')}');" class="close"></div>
                        <div title="返回上级" onclick="LinkTo('{$backurl}');" class="goback"></div>
                    </div>
                </div>
                <div class="main_mid">
                    <div class="main_mid_left"></div>
                    <div class="main_mid_right"></div>
                    <div class="main_mid_main">
                        <div class="pano_menu">
                            {:W("Panomenu",array("pano_id"=>$pano_id,"num"=>4))}
                        </div>
                        <div class="none_main">
                            <div class="action_main">
                                <div class="action_title"><a href="{$backurl}">地图设置</a> - 节点设置</div>
                                <div class="action_web">
                                    <form name="form1" action="" onsubmit="return checksb();" enctype="multipart/form-data" method="post">
                                        <input type="hidden" name="dopost" value="save" />
                                        <input type="hidden" name="view_id" id="view_id" value="{$view_id}" />
                                        <input type="hidden" name="map_id" id="map_id" value="{$map_id}" />
                                        <table width="100%" border="0" cellpadding="4" cellspacing="1" align="center">
                                            <tr class="tr_white" height="40">
                                                <td align="right"><b>节点开关：</b></td>
                                                <td>
                                                    <span class="onoff easyui-tooltip dd" title="是否开启该节点" target="open" value="{$node['open']}"></span>
                                                    <input type="hidden" id="open" name="open" value="{$node['open']}" />
                                                </td>
                                            </tr>
                                            <tr class="tr_white" height="36">
                                                <td align="right" width="100"></td>
                                                <td align="left">
                                                    <div class="mypano" id="mypano"></div>
                                                    <script type="text/javascript">
                                                        embedpano({
                                                            id: "krpano",
                                                            swf: "__PUBLIC__/pano/pano.swf",
                                                            xml: "{:U('mapxml',array('map_id' => $map_id,'view_id'=>$view_id,'type'=>'node'))}",
                                                            target: "mypano",
                                                            html5: "auto", wmode: "transparent"
                                                        });</script>
                                                </td>
                                            </tr>
                                            <tr class="tr_white" height="36">
                                                <td align="right" width="100"><b>节点图片：</b></td>
                                                <td align="left">
                                                    <input type="text" id="node_url" name="node_url" value="{$node['node_url']}" sbname="节点图片" class="longinputcube cs"/>
                                                    <input type="button" class="btn3" id="uppic" value="点击上传图片" />
                                                </td>
                                            </tr>

                                            <script type="text/javascript">
                                                $("#uppic").uploader("image", "backimg");
                                                function backimg(data) {
                                                    $.ajax({
                                                        url: "{:U('ajax/map')}",
                                                        type: "POST",
                                                        dataType: "script",
                                                        data: {
                                                            dopost: "node",
                                                            pano_id: "{$pano_id}",
                                                            imgurl: data
                                                        },
                                                        success: function() {
                                                            $("#node_url").val(backfile);
                                                            sendimg(backfile);
                                                        }
                                                    });
                                                }
                                                function sendimg(data) {
                                                var krpano = document.getElementById("krpano");
                                                    krpano.call("changenodepic(" + data + ")");
                                                    krpano.call("activatespot(spot,0);");
                                                }
                                                function uptu() {
                                                    $("#uppic").click();
                                                }
                                                function setscale(data) {
                                                    var krpano = document.getElementById("krpano");
                                                    var realdata = data / 100;
                                                    krpano.call('set(layer[spot].scale,' + realdata + ')');
                                                }
                                                function setalpha(data) {
                                                    var krpano = document.getElementById("krpano");
                                                    var realdata = data / 100;
                                                    krpano.call('set(layer[spot].alpha,' + realdata + ')');
                                                }
                                                function setheading(data) {
                                                    var krpano = document.getElementById("krpano");
                                                    krpano.call('set(plugin[radar].heading, ' + data + ');');
                                                }
                                            </script>
                                            <tr class="tr_white" height="36">
                                                <td align="right" width="100"><b>节点大小：</b></td>
                                                <td align="left">
                                                    <input class="easyui-slider" style="width:200px" name="scale" id="scale" value="{$node['scale']*100|default=100}"
                                                           data-options="showTip:true,
                                                           max:200,
                                                           tipFormatter: function(value){
                                                           return value+'%';
                                                           },
                                                           onChange:function(value){
                                                           setscale(value);
                                                           }"
                                                           />
                                                </td>
                                            </tr>
                                            <tr class="tr_white" height="36">
                                                <td align="right" width="100"><b>节点透明度：</b></td>
                                                <td align="left">
                                                    <input class="easyui-slider" style="width:200px" name="alpha" id="alpha" value="{$node['alpha']*100|default=100}"
                                                           data-options="showTip:true,
                                                           max:100,
                                                           tipFormatter: function(value){
                                                           return value+'%';
                                                           },
                                                           onChange:function(value){
                                                           setalpha(value);
                                                           }"
                                                           />
                                                </td>
                                                <!--                                            </tr>  <tr class="tr_white" height="36">
                                                                                                <td align="right" width="100"><b>UI角度：</b></td>
                                                                                                <td align="left">
                                                                                                    <input class="easyui-slider" style="width:359px" name="rotate" id="rotate" value="{$map['rotate']|default=0}"
                                                                                                           data-options="showTip:true,
                                                                                                           max:359,
                                                                                                           tipFormatter: function(value){
                                                                                                           return value+'°';
                                                                                                           },
                                                                                                           onChange:function(value){
                                                                                                           setrotate(value);
                                                                                                           }"
                                                                                                           />
                                                                                                </td>
                                                                                            </tr>-->
                                                <!--                                            <tr class="tr_white hide" height="36">
                                                                                                <td align="right" width="100"><b>热点定位中心点：</b></td>
                                                                                                <td align="left">
                                                                                                    <div id="spot_edgebox">
                                                                                                        <input type="hidden" id="align" value="leftbottom" name="align"/>
                                                                                                        <input type="button" onclick="changeCenter('lefttop');" class="btn1 lefttop" value="左上" />
                                                                                                        <input type="button" onclick="changeCenter('top');" class="btn1 top" value="上" />
                                                                                                        <input type="button" onclick="changeCenter('righttop');" class="btn1 righttop" value="右上" /><br/>
                                                                                                        <input type="button" onclick="changeCenter('left');" class="btn1 left" value="左" />
                                                                                                        <input type="button" onclick="changeCenter('center');" class="btn1 center" value="中" />
                                                                                                        <input type="button" onclick="changeCenter('right');" class="btn1 right" value="右" /><br/>
                                                                                                        <input type="button" onclick="changeCenter('leftbottom');" class="btn1 leftbottom" value="左下" />
                                                                                                        <input type="button" onclick="changeCenter('bottom');" class="btn1 bottom" value="下" />
                                                                                                        <input type="button" onclick="changeCenter('rightbottom');" class="btn1 rightbottom" value="右下" />
                                                                                                    </div>
                                                                                                </td>
                                                                                            </tr>
                                                                                            <script type="text/javascript">
                                                                                                setSpotcenter("#spot_edgebox", "{$map['align']|default='leftbottom'}");
                                                                                            </script>-->
                                            <tr class="tr_white" height="10">
                                                <td colspan="2"></td>
                                            </tr>
                                            <tr class="tr_white" height="36">
                                                <td align="right" width="100"><b>雷达偏转角度：</b></td>
                                                <td align="left">
                                                    <input class="easyui-slider" style="width:200px" name="heading" id="heading" value="{$node['heading']|default=0}"
                                                           data-options="showTip:true,
                                                           max:359,
                                                           tipFormatter: function(value){
                                                           return value+'°';
                                                           },
                                                           onChange:function(value){
                                                           setheading(value);
                                                           }"
                                                           />
                                                </td>
                                            </tr>

                                            <tr class="tr_white" height="36">
                                                <td align="right" width="100"><b>位置：</b></td>
                                                <td align="left">
                                                    <input type="text" name="x" id="x" class="shortinputcube cs" value="{$node['x']|default=0}" />
                                                    <input type="text" name="y" id="y" class="shortinputcube cs" value="{$node['y']|default=0}" />
                                                </td>
                                            </tr>

                                            <tr class="tr_white" height="10">
                                                <td colspan="2"></td>
                                            </tr>
                                            <tr class="tr_white" height="40">
                                                <td align="right" width="120"></td>
                                                <td align="left">
                                                    <input type="submit" class="blackbutton" value="提交" />
                                                </td>
                                            </tr>
                                            <tr class="tr_white" height="10">
                                                <td colspan="2"></td>
                                            </tr>
                                        </table>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="main_foot">
                    <div class="main_foot_left"></div>
                    <div class="main_foot_right"></div>
                    <div class="main_foot_main"></div>
                </div>
            </div>
        </div>
        <div id="cut" style="padding:10px;">
            <div id="left" style="width:60px;">
                <div id="background">
                    <div id="kuangkuang"></div>
                </div>
            </div>
            <div>
                高 度：<input id="height">
                宽 度：<input id="width"><br/>
                x坐标：<input id="kx" >
                y坐标：<input id="ky" >
            </div>
        </div>
    </body>
</html>
